<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>项目详情</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/main.css" />
    <link rel="stylesheet" type="text/css" href="../../css/project.css" />
</head>
<body>
  <div id="header">
      <div id="back"></div>
      <h3>项目经理列表</h3>
  </div>
  <div id="all">

  </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.js"></script>
<script type="text/javascript">
apiready=function(){
  //先选择项目经理
  if(api.pageParam.projectManager){
    var projectManager=api.pageParam.projectManager;
    //加载项目经理列表
      if(projectManager.length==0){
        toast("对不起，该公司项目经理暂无","middle");
      }else{
          var common=[];
        $.each(projectManager, function(commentIndex, comment){
          var avatarUrl;
          if(projectManager[commentIndex].avatarUrl=="#"){
            avatarUrl='http://img1.3lian.com/gif/more/11/201206/a5194ba8c27b17def4a7c5495aba5e32.jpg';
          }else{
            avatarUrl=projectManager[commentIndex].avatarUrl;
          }
          var mana={
            placeholderImg: 'widget://res/img/ic/listContact.png',
            img: avatarUrl,
            title: projectManager[commentIndex].studentName,
            titleSize:16,
            titleColor:'#777'
          };
          common.push(mana);
       });

        var listContact = api.require('listContact');
        listContact.open({
            h: api.frameHeight,
            y:'60',
            cellBgColor:'#fff',
            cellHeight:'70',
            data: {
                common: common
            },
            fixedOn: api.frameName
        }, function(ret2, err) {
            if (ret2) {
                var retIndex=ret2.index;
                //console.log("PMname="+ret[retIndex].nickname+"PMaid="+ret[retIndex].aid);
                // listContact.close();
                api.openWin({
                    name: 'chat',
                    url: 'chat.html',
                    pageParam: {
                        PMname: projectManager[retIndex].studentName,
                        PMaid:projectManager[retIndex].studentId
                    }
                });
            } else {
                //alert(JSON.stringify(err));
            }
        });
    }
  }
}
//jquery
$(function(){
  back();
})
</script>
<script type="text/javascript" src="../../script/main.js"></script>
</html>
